CREATE OR REPLACE
TRIGGER STATS_TRIGGER
BEFORE INSERT ON STATS
FOR EACH ROW WHEN ( NEW.STATS_ID IS NULL)
BEGIN
	SELECT STATS_SEQ.NEXTVAL
	INTO :NEW.STATS_ID
	FROM DUAL;
END;